<?php

	/**
    * @framework : My Framework
    *
    * @author: cuongnc.it659@gmail.com - Nguyễn Chí Cường.
    *
    */

	class model_navbar extends my_model
	{

		protected $_table;

		public function __construct()
        {
            parent::__construct();
            $this->_table = "tbl_pages";
        }

		public function getNav()
		{
			$this->where(array('pages_status'=>1));

			$this->get($this->_table);

			if($this->num_rows() > 0)
				return $this->fetch_all();
			return FALSE;
		}

        public function getPagesBySlug($data = array())
        {
            if(!empty($data))
            {
                $this->where($data);
                $this->get($this->_table);

                if($this->num_rows() > 0)
                    return $this->fetch_one();
                return FALSE;
            }

            return FALSE;
        }


	}


    /*End of layout.php*/
    /*Location: my_framework/controllers/layout.php */